package com.ruoyi.web.controller.xcx;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.AOperationRecords;
import com.ruoyi.system.domain.vo.XcxACheckInforVO;
import com.ruoyi.system.domain.vo.XcxADataInfoVO;
import com.ruoyi.system.domain.vo.XcxAInformationVO;
import com.ruoyi.system.domain.vo.XcxATrainInforVO;
import com.ruoyi.system.service.IAOperationRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * 下载收藏分享点赞记录Controller
 *
 * @author ruoyi
 * @date 2024-05-16
 */
@RestController
@RequestMapping("/xcx/aOperationRecords")
public class XcxAOperationRecords extends BaseController {

    @Autowired
    private IAOperationRecordsService aOperationRecordsService;

    /**
     * 新增/删除 --下载收藏分享点赞记录
     */
    @PostMapping("/opeRecord")
    public AjaxResult opeRecord(@RequestBody AOperationRecords aOperationRecords)
    {
        return success(aOperationRecordsService.insertAOperationXcxRecords(aOperationRecords));
    }


    /**
     * 查询我的分享和查询我下载中朋友圈资料
     */
    @PostMapping("/queryInfoOperation")
    public TableDataInfo queryInfoOperation(@RequestBody AOperationRecords aOperationRecords)
    {
        startPage();
        List<XcxAInformationVO> list =  aOperationRecordsService.queryInfoOperation(aOperationRecords);
        return getDataTable(list);
    }

    /**
     * 查询我的收藏和查询我下载中素材库资料
     */
    @PostMapping("/queryDataOperation")
    public TableDataInfo queryDataOperation(@RequestBody AOperationRecords aOperationRecords)
    {
        startPage();
        List<XcxADataInfoVO> list = aOperationRecordsService.queryDataOperation(aOperationRecords);
        return getDataTable(list);
    }

    /**
     * 查询我的收藏和查询我下载中打卡资料
     */
    @PostMapping("/queryCheckOperation")
    public TableDataInfo queryCheckOperation(@RequestBody AOperationRecords aOperationRecords)
    {
        startPage();
        List<XcxACheckInforVO> list = aOperationRecordsService.queryCheckOperation(aOperationRecords);
        return getDataTable(list);
    }


    /**
     * 查询我收藏 培训资料
     */
    @PostMapping("/queryTrainOperation")
    public TableDataInfo queryTrainOperation(@RequestBody AOperationRecords aOperationRecords)
    {
        startPage();
        List<XcxATrainInforVO> list = aOperationRecordsService.queryTrainOperation(aOperationRecords);
        return getDataTable(list);
    }

}
